﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ParticeInClass
{
    [Online(Version = 3)]
    class Student : Teacher
    {
        public int lessons = 0;
        private Teacher teacher = new Teacher();
        private int age;  
        public String sname;

        public int Score { get; set; }
        public string Name { get; set; }
        public List<Major> Majors { get; set; }
        public Student (String sname)
        {
            Console.WriteLine("源栈欢迎你，" + sname);
        }

        public Student()
        {
            
        }

        public int getAge()
        {
            return age;
        }

        public Student(int age)
        {
            this.age = age;
        }

        public void attend()
        {
            lessons++;
            teacher.points++;
            Console.WriteLine("学生参加了" + lessons + "节课");
            Console.WriteLine("老师的积分是" + teacher.points);
        }

        public override void Eat()   //注意关键字 override
        {
            Console.WriteLine("学生吃饭");
        }


    }

    class AgileStudent : Student
    {
        public override void Eat()  //继续override
        {
            //Console.WriteLine("跑得快的学生先吃饭");
            base.Eat();     //base指Student
        }
    }
}
